import Vue from 'vue'
import Router from 'vue-router'

import Login from '../views/Login'
import Home from '../views/Home'
import UserList from "../views/admin/user/UserList";
import UserAdd from "../views/admin/user/UserAdd";
import UserEdit from "../views/admin/user/UserEdit";
import RoleList from "../views/admin/role/RoleList";
import RoleAdd from "../views/admin/role/RoleAdd";
import RoleEdit from "../views/admin/role/RoleEdit";
import PermissionList from "../views/admin/permission/PermissionList";
import PermissionAdd from "../views/admin/permission/PermissionAdd";
import PermissionEdit from "../views/admin/permission/PermissionEdit";
import MenuList from "../views/admin/menu/MenuList";
import ModifyPassword from "@/views/admin/user/ModifyPassword";
import ModifyAvatar from "@/views/admin/user/ModifyAvatar";
Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      redirect:'/login'
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/admin',
      name: 'Home',
      component:Home,
      children:[
        {path:'user/list',component:UserList},
        {path:'user/add',component:UserAdd},
        {path:'user/edit/:id',component:UserEdit},
        {path:'user/modify-password',component:ModifyPassword},
        {path:'user/modify-avatar',component:ModifyAvatar},
        {path:'role/list',component:RoleList},
        {path:'role/add',component:RoleAdd},
        {path:'role/edit/:id',component:RoleEdit},
        {path:'permission/list',component:PermissionList},
        {path:'permission/add',component:PermissionAdd},
        {path:'permission/edit/:id',component:PermissionEdit},
        {path:'menu/list',component:MenuList},
      ]
    }
  ]
})
